package contest1609;

import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

public class B2 {
    static Scanner cin = new Scanner(System.in);

    public static void main(String[] args) {
        int n = cin.nextInt();
        Set<Integer> v = new TreeSet<>();
        for (int i = 0; i < n; i++) {
            v.add(cin.nextInt());
        }
        System.out.println(v.size());
        for (Integer i : v) {
            System.out.print(i + " ");
        }
        cin.close();
    }
}
